#include <iostream>
#include <string>

class Student
{
public:
    Student(std::string name, int id, int score1, int score2, int score3);
    double average();
    void display();
private:
    std::string Name;
    int Id;
    int Score[3];
};

Student::Student(std::string name, int id, int score1, int score2, int score3)
{
    Name = name;
    Id = id;
    Score[0] = score1;
    Score[1] = score2;
    Score[2] = score3;
}
double Student::average()
{
    return (Score[0] + Score[1] + Score[2]) / 3.0;
}
void Student::display()
{
    std::cout<<"姓名:"<<Name<<"\n"<<"学号:"<<Id<<"\n"<<"平均分:"<<average()<<std::endl;
}

int main()
{
    Student a("XuanSong",1,30,60,90);
    a.display();
    return 0;
}